.text
.section .rodata
.align 8
.LC0:
    .string "value1 = %d, value2 = %d\n"
.LC1:
    .string "%2d %d\n"
.LC2:
    .string "address of arr[-1]: %p\n"
.LC3:
    .string "address of arr[4]: %p\n"
.LC4:
    .string "address of value1: %p\n"
.LC5:
    .string "address of value2: %p\n"

.text
.globl main
.type main, @function
main:
    pushq %rbp
    movq %rsp, %rbp

    // sizeof(value1) + SIZE * sizeof(int) + sizeof(value2) + sizeof(i) = 28
    subq $32, %rsp
    // value1
    movl $44, -4(%rbp)
    // -8~-20: arr
    // value2
    movl $88, -24(%rbp)
    // -28(%rbp) /* i */
    movl -4(%rbp) /* value1 */, %esi
    movl -24(%rbp) /* value2 */, %edx
    movq $.LC0, %rdi
    movl $0, %eax
    call printf

    movl $-1, -28(%rbp) /* i */
    jmp .L2
.L1:
    movl -28(%rbp) /* i */, %eax
    movl %eax, %edx
    sall $1, %edx
    addl $1, %edx
    cltq
    movl %edx, -20(%rbp, %rax, 4)
    incl -28(%rbp) /* i */
.L2:
    movl -28(%rbp) /* i */, %eax
    cmpl $4, %eax
    jle .L1

    movl $-1, -28(%rbp) /* i */
    jmp .L4
.L3:
    movl -28(%rbp) /* i */, %esi
    movl %esi, %eax
    cltq
    movl -20(%rbp, %rax, 4), %edx
    movq $.LC1, %rdi
    movl $0, %eax
    call printf
    incl -28(%rbp) /* i */
.L4:
    movl -28(%rbp) /* i */, %eax
    cmpl $7, %eax
    jl .L3

    movl -4(%rbp) /* value1 */, %esi
    movl -24(%rbp) /* value2 */, %edx
    movq $.LC0, %rdi
    movl $0, %eax
    call printf

    leaq -20(%rbp), %rsi
    subq $4, %rsi
    movq $.LC2, %rdi
    movl $0, %eax
    call printf

    leaq -20(%rbp), %rsi
    addq $16, %rsi
    movq $.LC3, %rdi
    movl $0, %eax
    call printf

    leaq -4(%rbp) /* value1 */, %rsi
    movq $.LC4, %rdi
    movl $0, %eax
    call printf

    leaq -24(%rbp) /* value2 */, %rsi
    movq $.LC5, %rdi
    movl $0, %eax
    call printf

    movl $1, %eax
    movq %rbp, %rsp
    popq %rbp
    ret